Repository navigation
Conversation
Leaves are proof-of-burn. Private batches pay batch-level exits, and the production shape is 8 leaves, 32 exit slots, and public-batch arity 89. Vendor the Apache-2.0 crystals rewrite so zeroize 1.9.1 can unify with the circuits. Co-authored-by: illuzen <illuzen@users.noreply.github.com>
n13
left a comment
There was a problem hiding this comment.
Verdict: Request changes
Reviewer: GPT-6.1 Sol
Reviewed commit b91d081ffc24b0236351e62ffb61a95c54203062 against base bc3bf6ac2702509216bfbf88eb734f411a555f7d.
-
[P2] Apply the volume fee once to the batch total before rounding. In src/cli/wormhole.rs:1375–1381, the default payout still sums individually rounded leaf payouts. The pinned circuit now allows
floor(sum(real inputs) * (10000 - fee_bps) / 10000). For eight burns of 100 quantized units at 4 bps, the CLI pays 792 units instead of 799: 7.92 tokens instead of 7.99. Those extra seven units cannot be recovered after the burns' nullifiers are spent. A standalone Rust probe using the actual extractedcompute_batch_exitssource reproduced this; eight one-unit burns likewise produce zero payout despite permitting seven units. The same rounding occurs incompute_batch_exits(line 488), reward collection (src/collect_rewards_lib.rs:859–865), and dissolve (line 4207). Use one shared calculation with a wide batch input total, apply the fee once, then partition the payout. Cover these sibling paths with tests asserting the batch formula; the current expected-total helper repeats the per-leaf rounding. -
[P2] Preserve the crates.io release and installation path. The new git dependencies in Cargo.toml:150–151, and the other circuit dependency declarations, omit version requirements.
cargo package --locked --no-verify --offlinefails immediately:all dependencies must have a version requirement specified when packaging, identifyingqp-ownership-circuit. The existing release workflow runscargo publish, so its publication job now fails. Addingversion = "4.4.0"alone would select the older, incompatible circuits when Cargo removes git declarations for publication. The root-only crystals patches also cannot supply the changed API to downstream SDK consumers. Publish compatible circuit/crystals releases and reference their versions, or provide another publishable dependency arrangement, then verify packaging and a downstream install/build.
Validation:
- Passed 141 focused library tests: wormhole (58), reward collection (19), artifact manifests (15), and wallets (49), each command capped with
timeout 60and circuit generation skipped. - Passed
SKIP_CIRCUIT_BUILD=1 cargo clippy --all-targets --locked --offline -- -D warnings, pinned rustfmt, Taplo, andgit diff --check. - Confirmed vendored production source matches crystals revision
279cd773f819f344d56a37d11af47390a92f528b; source differences are omitted test modules, and both licenses match the upstream root license. - Full-library run reached the 60-second limit: 454 tests had passed and the artifact-dependent batch-verifier test had failed because
generated-binswas absent with generation skipped. Production circuit generation and on-chain acceptance were not exercised. - GitHub Security Audit failed on five advisories affecting dependency versions already present in the base lockfile. Format and dependency-cooldown checks passed; the remaining substantive CI jobs were still running at the last check.
The private-batch circuit allows floor(sum(inputs) * (10000 - fee) / 10000). Default payouts, reward collection, and dissolve now use that total instead of summing per-leaf floors. Circuits, the Apache crystals rewrite, and qp-dilithium-crypto are path dependencies with versions, published as quantus-* crates so packaging does not fall back to the older qp-* 4.4.0 releases. The release job publishes those crates before quantus-cli. Co-authored-by: illuzen <illuzen@users.noreply.github.com>
n13
left a comment
There was a problem hiding this comment.
Verdict: Request changes
Reviewer: GPT-6.1 Sol
Reviewed head 2d7d9dd5c6ab2423b83a2ab7d8e274694d489ac8 against base bc3bf6ac2702509216bfbf88eb734f411a555f7d.
- [P1] Enable Plonky2 randomness in the build dependency graph. third_party/qp-zk-circuits/wormhole/circuit-builder/Cargo.toml:22 disables default features and enables only
std. The build script generates a private-batch circuit with zero knowledge enabled, which requiresqp-plonky2/rand. The CLI's normal dependency enablesrand, but Cargo separates normal and build dependency features, so that does not enable it for the build script. After cleaning only the isolated worktree's CLI artifacts,timeout 60 env -u SKIP_CIRCUIT_BUILD cargo build --locked --offlinefailed withCannot use zero_knowledge without rand featureatqp-plonky2-1.6.0/src/plonk/circuit_builder.rs:1031. Both Ubuntu and macOS CI fail at the same point. This blocks ordinary builds, release builds, and default publish/install verification. Enablerandin the circuit-builder's Plonky2 dependency, or another shared proving dependency that reaches the host graph, then rerun an ordinary build with circuit generation enabled. The checks usingSKIP_CIRCUIT_BUILD=1bypass this failure.
The earlier batch-rounding finding is fixed across default aggregation, multiround, reward collection, and dissolve. Versioned publishable dependencies and the dependency-ordered publication workflow address the earlier packaging declarations; the build failure above remains a release blocker.
Validation:
- Passed 223 focused library tests: wormhole CLI (50), wormhole library (6), reward collection (19), artifact manifests (15), wallet paths (102), and airdrop/derivation (31). Each Cargo test command used
SKIP_CIRCUIT_BUILD=1 timeout 60 cargo test --locked --offline --lib <filter>; the library tests include successful dummy leaf-proof generation. - A standalone Rust probe using the actual fee and dissolve helper sources passed 23,328 small-batch fee/conservation cases and u32 boundary checks, including the 799-unit and 7-unit rounding cases.
- Passed strict all-target Clippy, pinned rustfmt, Taplo,
git diff --check, publication-script syntax, and a metadata check of all 14 packages' publication order and exact local dependency versions. - Circuit Rust sources match upstream
3ba7cefafter formatting; crystals production sources match279cd773with test-module omissions; the Dilithium adapter sources match published 0.6.1 after formatting. License comparisons passed. quantus-wormhole-inputspackages successfully. CLI packaging still requires the new crate names to be published first; downstream registry installation was not verified.- GitHub Security Audit reports five vulnerabilities; all five affected crate versions are unchanged from the base lockfile. Production private/public circuit generation cannot complete because of the finding above, and on-chain acceptance was not exercised.
The private-batch and ownership circuits use row blinding. Plonky2 panics while building them unless its rand feature is on, and the build script does not inherit that feature from the CLI's normal dependency. Co-authored-by: illuzen <illuzen@users.noreply.github.com>
n13
left a comment
There was a problem hiding this comment.
Verdict: Approve
Reviewer: GPT-6.1 Sol
Reviewed head 08c12a365784a2a86eadff829dd2cd3eee7e3f73 against base bc3bf6ac2702509216bfbf88eb734f411a555f7d.
No blocking findings remain. The previous randomness failure is fixed in the build dependency graph: a clean CLI library build with circuit generation enabled completes successfully for the production 8-leaf / 32-exit / 89-arity shape. The fee-rounding fix applies the fee once to the batch sum across default aggregation, multiround, reward collection, and dissolve. Versioned vendored dependencies and dependency-ordered publication address the earlier packaging declarations.
Validation:
- Passed 224 focused library tests: wormhole CLI (50), wormhole library (6), reward collection (19), artifact manifests (15), wallet paths (102), airdrop/derivation (31), and loading generated private/public batch verifiers (1). Each test command was capped with
timeout 60. - Passed a standalone Rust probe using the actual fee/apportionment/dissolve helper sources: 39,652 independent fee, conservation, and boundary cases, including the 799-unit and 7-unit rounding cases.
- Passed
env -u SKIP_CIRCUIT_BUILD cargo build --lib --locked --offlineafter cleaning this worktree's CLI artifacts. Production circuit generation completed in 79 seconds; the build completed in 94 seconds. An independent verifier harness accepted the generated canonical leaf artifacts and verified both generated dummy leaf and private-batch proofs. - Passed
SKIP_CIRCUIT_BUILD=1 cargo clippy --all-targets --locked --offline -- -D warnings, pinned rustfmt, Taplo, andgit diff --check. - All 59 vendored circuit Rust files match upstream
3ba7cefafter formatting. Crystals production sources match279cd773, with only test-module omissions; adapter sources match published 0.6.1 after formatting. Circuit/crystals license comparisons passed. quantus-wormhole-inputspackages and verifies successfully. Checked all 14 packages' publication order, 36 local dependency declarations and their exact versions, and publication-script syntax.
Validation limits: full CLI packaging in offline mode stops because the new quantus-dilithium-crypto package is unavailable in the local registry index. Publishing the new dependency versions and downstream registry installation remain unverified. On-chain acceptance was not exercised; deployment requires a runtime built from matching circuits, as documented in the PR.
GitHub format, dependency-cooldown, and analysis checks passed. Security Audit reports five vulnerabilities; all five affected dependency versions are unchanged from the base lockfile. Ubuntu/macOS build-and-test and Examples were still running at the last check.
cargo audit failed on quinn-udp 0.5.15, rustls-webpki 0.103.15, webpki-roots 1.0.9, and webpki-root-certs 1.0.9. Those releases sit inside ranges the existing dependencies already allow. crypto-bigint 0.5.5 stays. k256 0.13, required by every published sp-core, pins elliptic-curve 0.13, which only accepts crypto-bigint ^0.5. The patched line starts at 0.7.6. Co-authored-by: illuzen <illuzen@users.noreply.github.com>
The 30-day cooldown rejects rustls-webpki 0.103.17 and the 1.0.12 root bundles. 0.103.16 and 1.0.10 are the first releases that fix RUSTSEC-2026-0381, 0382, and 0383, and they are still inside that window. Co-authored-by: illuzen <illuzen@users.noreply.github.com>
Cooldown-bypass-reason: RUSTSEC-2026-0381, RUSTSEC-2026-0382, and RUSTSEC-2026-0383 are fixed only by rustls-webpki 0.103.16 and webpki root bundles 1.0.10, published 2026-10-19 and 2026-10-20, which are still inside the 30-day cooldown.
The CLI builds and proves against qp-zk-circuits
3ba7cefaee5dc1d382ec4d29e19c0f02882b1e05(proof-of-burn). Those sources are vendored underthird_party/qp-zk-circuitsand published asquantus-wormhole-*,quantus-zk-circuits-common, andquantus-ownership-*4.5.0. A crates.io release therefore does not resolve the olderqp-*4.4.0crates. Rust library names stayqp_wormhole_*,qp_zk_circuits_common, andqp_ownership_*.Volume fee
The private-batch circuit allows
floor(sum(real inputs) * (10000 - fee_bps) / 10000). Default aggregate payouts, reward collection, and dissolve apply that fee once to the batch sum, then partition it. Eight burns of 100 quantized units at 4 bps pay 799, not the per-leaf sum 792. Eight 1-unit burns pay 7. Explicit--exit-amountis unchanged.Crystals
Published
qp-rusty-crystals4.1.1 pinszeroize =1.8.2, which cannot unify with the circuits.third_party/qp-rusty-crystalsis the Apache-2.0 rewrite at279cd773, published asquantus-crystals-dilithiumandquantus-crystals-hdwallet4.2.0. Seed, wormhole address, and ML-DSA public key match 4.1.1.qp-dilithium-crypto0.6.1 is vendored asquantus-dilithium-crypto0.7.0so it links those crates instead of 4.1.1. There is no[patch.crates-io].Release
The publish job uploads the vendored crates in dependency order, then
quantus-cli. "Already uploaded" is success, so a later CLI release can repeat the job.cargo packageofquantus-wormhole-inputssucceeds.cargo packageofquantus-clifails until these names exist on crates.io, and it does not rewrite them toqp-*4.4.0. The release token has to be allowed to create the new crate names. This agent cannot publish.Chain
Quantus chain is still on
qp-wormhole-*4.3.0. Proofs from this CLI will not verify on chain until the runtime is built from the same circuits.Production shape remains 8 leaves, 32 exit slots, public-batch arity 89. Generating that shape completed in about two and a half minutes. The private-batch and ownership circuits need
qp-plonky2'srandfeature; the build script enables it directly because it does not inherit features from the CLI's normal dependency.Security audit
cargo auditwas failing on four crates that already had patched releases inside their existing ranges.quinn-udp0.5.16 is old enough for the cooldown.rustls-webpki0.103.16 andwebpki-roots/webpki-root-certs1.0.10 are the oldest releases that clear RUSTSEC-2026-0381, 0382, and 0383. They were published on 2026-10-19 and 2026-10-20, so the 30-day cooldown still rejects them.crypto-bigint0.5.5 (RUSTSEC-2026-0387) has no compatible fix.sp-corethrough 43.0.0 requiresk2560.13, which requireselliptic-curve0.13 andcrypto-bigint^0.5, while the patched line starts at 0.7.6. That advisory is ignored in.cargo/audit.tomluntil Substrate moves offk2560.13.